package com.company.cloud.article.modules.api.fallback;

import com.company.cloud.article.modules.api.response.ArticleReap;
import com.company.cloud.article.modules.api.service.ArticleClientService;
import com.company.cloud.common.bean.BaseClientResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Set;

@Log4j2
@Component
public class ArticleClientServiceFallbackFactory implements FallbackFactory<ArticleClientService>{

	@Override
	public ArticleClientService create(Throwable cause) {
		return new ArticleClientService() {

			@Override
			public BaseClientResult<ArticleReap> getCompanyArticleByNo(String companyArticleNo) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<Map<String, ArticleReap>> getCompanyArticleMapByNos(Set<String> companyArticleNos) {
				return BaseClientResult.callbackError();
			}

		};
	}


}
